Most computers in use today include a hard disk drive. A hard disk drive is typically a device including a magnetic head, a motor, and one or more platters that store information. The motor turns a platter underneath the magnetic head. The platter contains electrically encoded data that is detected by the magnetic head as the head passes over the platter. The platter can be read from or written to and is generally used to store data that will be accessed by the computer. The hard disk drive is typically referred to as random access memory and is familiar to those skilled in the art.
Typically, data is arranged in concentric circles on the platter. The magnetic head is moved along a radius of the platter, and the magnetic head reader/writer accesses particular locations within the platter as the platter spins under the magnetic head. Those skilled in the art are familiar with the read and write operations of hard disk drives.
Unfortunately, constantly spinning the platter in the hard disk drive consumes a large amount of power. Specifically, a motor must be devoted to spinning the platter to allow access to the full physical array of data on the platter. Powering a mechanical device, such as a motor, consumes a significant amount of power relative to the power consumed by the electronic circuitry within a computer.
The consumption of power is a major concern in many computers. Specifically, power consumption is a major factor in the design and construction of portable computers. Many in the industry anticipate that over fifty-percent (50%) of computers sold within 10 years will be portable. The concern over power consumption relating to portable computers arises due to their reliance upon batteries with a short life.
One power management technique commonly used in portable computers is turning off the hard disk drive motor when the hard disk drive has not been used recently. There are several methods of turning off the hard disk drive motor while leaving the remainder of the computer circuitry on. Many computers include a "sleep" button that the user may depress to power down the hard disk drive motor without powering down the entire computer. Thus, if a user needs to sit and think or perform tasks that do not require access to the hard disk drive, the user can depress the sleep button. Depressing the sleep button powers down the hard disk drive, meaning that the motor stops spinning the platter, but the user will not have to reboot the entire computer to initiate operations again. The Basic Input/Output system driver (BIOS driver) commonly found in personal computers receives the signal from the "sleep" key and controls power down of the hard disk drive. This allows the user to conserve battery power that would otherwise be wasted powering the motor in the hard disk drive when the hard disk drive is not being accessed.
Other methods of powering down the hard disk drive have also been developed. Those skilled in the art are familiar with computers that include a timed power down of a hard disk drive that is controlled by the BIOS driver. The BIOS driver can be programmed to power down the hard disk drive after the passage of a predetermined time period during which the hard disk drive has not been accessed. For example, the BIOS driver can be set to power down the hard disk drive automatically if the hard disk drive is not accessed for five minutes. If the user leaves the computer for longer than the predetermined period of time, the hard disk drive will automatically be powered down to conserve power.
Thus, there are at least two different methods for powering down the hard disk drive via the BIOS driver. As computer technology has evolved, however, control over the hard disk drive has become more diluted. Specifically, in operating systems marketed under the "WINDOWS" trademark by Microsoft Corporation, the assignee of the present invention, a driver other than the BIOS driver may also control a hard disk drive. Those skilled in the art are familiar with the operating system sold under the "WINDOWS" trademark and operating systems compatible therewith. A driver in such operating systems is typically called an Integrated Device Electronics driver (IDE driver). The IDE driver serves as the interface between such operating systems and the hard disk drive.
Thus, there are two separate drivers that have access to and can control a single hard disk drive in a computer. The BIOS driver is the first driver that will interact with and control the hard disk drive. The IDE driver is the second driver that will access and control the hard disk drive.
Unfortunately, the BIOS driver was written well before the creation of IDE drivers. Thus, the BIOS driver assumes that it is in sole control of the hard disk drive. The BIOS driver therefore may take action to control the hard disk drive without knowing that another driver, the IDE driver, is also accessing the hard disk drive.
An example of a conflict from the above-referenced situation is when the BIOS driver attempts to power down the hard disk drive. The BIOS driver will power down the hard disk drive without regard for pending or future activities of the IDE driver relating to the hard disk drive. More specifically, the user running an application program in conjunction with the operating system might want to store data to the hard disk drive through the IDE driver. The user would depress a save button to indicate that the data should be saved to the hard disk drive. "Lazy writing" will be used to store the data on the hard disk drive. Lazy writing is the process of sending data to the IDE driver wherein the data is stored in a file system manager buffer. After accepting the data in the file system manager buffer, the IDE driver signals the application program that the data has been written to the hard disk drive, even though the data has actually not been written to the hard disk drive. After a period of time, typically one to two seconds, the IDE driver will commit the data from the buffers in the file system manager to the hard disk drive. Lazy writing produces zero access time for write operations from the perspective of the application program, thereby increasing the speed of the computer from the perspective of the user of the computer.
Consider, however, what happens when the user saves data, and then immediately depresses the sleep button on the computer. Depressing the sleep button on the computer causes the BIOS driver to immediately begin to power down the hard disk drive. Thus, the hard disk drive will be powered down before or during write operations by the IDE driver, and before the data can be committed from the buffer in the file system manager to the hard disk drive. Typically, the IDE driver will attempt to commit the data to the hard disk drive during or after power down, resulting in at least a failure to put the data on the hard disk drive. More frequently, attempting to write to a down hard disk drive that is being powered down causes the entire computer to crash.
Other problems related to the above-referenced situation occur even more frequently. As set forth above, the BIOS driver can be programmed to power down the hard disk drive. The BIOS driver will not recognize activity by the IDE driver in accessing the hard disk drive. For example, the IDE driver could be actively and regularly transferring data to and from the hard disk drive. However, the BIOS driver will not detect such activity. Thus, the BIOS driver may time out due to a perceived lack of activity at the hard disk drive during the middle of, or right before, the IDE driver's accessing of the hard disk drive.
The above-referenced conflict is quite severe, as is recognized by those skilled in the art. Indeed, IDE drivers are generally not used in computers today despite the fact that they improve access times to the hard disk drive by fifty to sixty-five percent (50-65%) over the traditional BIOS driver. The high speed of the IDE drivers is thus wasted to avoid crashing the computer due to the BIOS driver powering down the hard disk drive while the IDE driver is operational.
Further complicating the situation is the fact that there is not a distinction between a laptop and desktop computer as far as the power management scheme in the computer is concerned. In other words, an IDE driver loaded on a desktop computer that is not subject to severe limitations on power consumption still is not used because the operating system can not tell whether the computer is a laptop or desktop unit. Despite the fact that the hard disk drive of a desktop computer will likely not be powered down because power conservation is not a concern, the IDE driver will not be used because of concern that the BIOS driver will power down the hard disk drive. The conflict regarding powering down the hard disk drive by the BIOS driver thus precludes the use of IDE drivers that could provide significant improvement in the speed of laptop and desktop computers.
Accordingly, there exists a need in the art for a method and apparatus for controlling power down of a hard disk drive when the hard disk drive is subject to control by two drivers.